package com.goodedeeds.domain.resource;

import com.youtills.domain.contact.Address;
import com.youtills.resource.Attribute;
import com.youtills.resource.Relationship;
import com.youtills.resource.Resource;

import java.util.List;

/**
 * TODO - !!!doc me!!!
 *
 * @author ravi.chiluveru
 * @since 23.0 (9/10/14)
 */
public abstract class GoodeDeedsAttribute {

    public static final Attribute.ListResourceAttribute<Project> projects = new Attribute.ListResourceAttribute<>("projects");

    public static final Attribute.IntegerAttribute projectStatus = new Attribute.IntegerAttribute("project_status");
    public static final Attribute.StringAttribute projectName = new Attribute.StringAttribute("project_name");
    public static final Attribute.StringAttribute projectKey = new Attribute.StringAttribute("project_key");
    public static final Attribute.StringAttribute projectDescription = new Attribute.StringAttribute("project_description");
    public static final Attribute.DateAttribute projectStartDate = new Attribute.DateAttribute("project_start_date");
    public static final Attribute.DateAttribute projectEndDate = new Attribute.DateAttribute("project_end_date");
    public static final Attribute.CurrencyAttribute projectGoalAmount = new Attribute.CurrencyAttribute("project_goal_amount");

    public static final Attribute.IntegerAttribute defaultPageId = new Attribute.IntegerAttribute("default_page_id");

    public static final Attribute.StringAttribute preview_html = new Attribute.StringAttribute("preview_html");


    public static final Attribute.IntegerAttribute status = new Attribute.IntegerAttribute("status");
    public static final Attribute.StringAttribute key = new Attribute.StringAttribute("key");

    public static final Relationship<Resource, Project> resource_project = new Relationship.Builder<>(Resource.class, Project.class)
            .setRelationshipId(Project.RL_RESOURCE_PROJECT)
            .setRelationshipName("Resource-Project")
            .setLeftClass(Resource.class)
            .setLeftMinCount(0)
            .setLeftMaxCount(1)
            .setRightClass(Project.class)
            .setRightMinCount(0)
            .setRightMaxCount(null)
            .setAllowDuplicate(false)
            .build();

    public static final Relationship<School, Project>school_project = new Relationship.Builder<School, Project>()
            .setRelationshipId(Project.RL_RESOURCE_PROJECT)
            .setRelationshipName("School-Project")
            .setLeftClass(School.class)
            .setLeftMinCount(0)
            .setLeftMaxCount(1)
            .setRightClass(Project.class)
            .setRightMinCount(0)
            .setRightMaxCount(null)
            .setAllowDuplicate(false)
            .build();

    public static final Relationship<School, Address> school_address = new Relationship.Builder<School, Address>()
            .setRelationshipId(Address.RL_ADDRESS__RESOURCE)
            .setRelationshipName("School-Address")
            .setLeftClass(School.class)
            .setLeftMinCount(0)
            .setLeftMaxCount(1)
            .setRightClass(Address.class)
            .setRightMinCount(0)
            .setRightMaxCount(null)
            .setAllowDuplicate(false)
            .build();
}
